package com.edu.spring.aop.proxy.statics;

import com.edu.spring.aop.MathCalculator;

public class CalculatorStaticProxy implements MathCalculator {
    private final MathCalculator target;

    public CalculatorStaticProxy(MathCalculator mathCalculator) {
        this.target = mathCalculator;
    }

    @Override
    public int add(int i, int j) {
        System.out.println("静态代理模式，执行了add方法...");
        return target.add(i, j);
    }

    @Override
    public int sub(int i, int j) {
        System.out.println("静态代理模式，执行了sub方法...");
        return target.sub(i, j);
    }

    @Override
    public int mul(int i, int j) {
        System.out.println("静态代理模式，执行了mul方法...");
        return target.mul(i, j);
    }

    @Override
    public int div(int i, int j) {
        System.out.println("静态代理模式，执行了div方法...");
        return target.div(i, j);
    }
}
